<?php
$url = $_SERVER['REQUEST_URI'];
$url = explode('/',$url);
$url_1 = "/".$url[1]."/".$url[2]."/";
$url_2 = explode('-',$url[3],2);
$url_2 = $url_2[1];
 if ($this->pageCount > 0) : ?>
<center>
<div class="paginator" align="center">
        <!--<span class="paginator-box">Trang <?php echo $this->current?>/<?php echo $this->pageCount?> </span>-->
        
        <?php if ($this->current != '1') : ?>
            <a title="Trang d?u" rel="first" class="paginator-first" href="<?php echo $url_1 ?>1-<?php echo $url_2 ?>">&lt;&lt;</a>
        <?php else : ?>
        <span class="paginator-first">&lt;&lt;</span>
        <?php endif ?>
        
        <?php if (isset($this->previous)) : ?>
        <a title="Trang tru?c" rel="prev" class="paginator-prev" href="<?php echo $url_1 ?><?php echo $this->previous?>-<?php echo $url_2 ?>">&lt;</a>
        <?php else : ?>
        <span class="paginator-prev">&lt;</span>
        <?php endif ?>
        
        <?php foreach ($this->pagesInRange as $page) : ?>
            <?php if ($page == $this->current) : ?>
            <span class="paginator-num"><?php echo $page ?></span>
            <?php else : $rel = $page > $this->current ? 'next' : 'prev'; ?>
            <a class="paginator-num" title="Trang <?php echo $page ?>" rel="<?php echo $rel ?>" href="<?php echo $url_1 ?><?php echo $page?>-<?php echo $url_2 ?>"><?php echo $page ?></a>
            <?php endif ?>
        <?php endforeach ?>
        
        <?php if (isset($this->next)) : ?>
        <a title="Trang ti?p" rel="next" class="paginator-next" href="<?php echo $url_1 ?><?php echo $this->next?>-<?php echo $url_2?>">&gt;</a>
        <?php else : ?>
        <span class="paginator-next">&gt;</span>
        <?php endif ?>
        
        <?php if ($this->current != $this->pageCount) : ?>
        <a title="Trang cu?i" rel="last" class="paginator-last" href="<?php echo $url_1 ?><?php echo $this->pageCount?>-<?php echo $url_2?>">&gt;&gt;</a>
        <?php else : ?>
        <span class="paginator-last">&gt;&gt;</span>
        <?php endif ?>
</div>
</center>
<?php endif ?>
